#include "widget.h"
#include "ui_widget.h"



Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    button = new QPushButton(this);
    button->setText("按钮");
    button->move(300, 200);
    // close是QWidegt内置的槽函数
    connect(button, &QPushButton::clicked, this, &Widget::handlerClicked);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::handlerClicked()
{
    this->setWindowTitle("按钮按下");
}

